The subject technology relates to caching executable code and, in particular, relates to selecting source code for compiling, serializing and caching the executable code and deserializing the cached executable code prior to execution.
Virtual Machines (VMs) are used for execution of software code upon on-demand compilation, also referred to as Just in Time (JIT) compilation, in which compilation of code is performed immediately prior to execution of the code or part of the code is compiled on-demand (e.g., lazily). When the code is embedded in a resource, for example a resource within a web page, the speed with which the resource can be rendered within an application (e.g., a browser) running on a client device depends upon the speed of execution of the embedded code. A user of the client device may access the same resource repeatedly within the same work session, for example a web browser session, or across multiple independent work sessions. However, if the code has to be compiled every time a user accesses the resource, a noticeably long time may be needed for each compilation.